package cn.iocoder.yudao.module.agri.dal.mysql.farmmodelstage;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.agri.dal.dataobject.farmmodelstage.FarmModelStageDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.agri.controller.admin.farmmodelstage.vo.*;

/**
 * 种养模型-生长阶段 Mapper
 *
 * @author 广东小蜂
 */
@Mapper
public interface FarmModelStageMapper extends BaseMapperX<FarmModelStageDO> {

    default PageResult<FarmModelStageDO> selectPage(FarmModelStagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FarmModelStageDO>()
                .eqIfPresent(FarmModelStageDO::getId, reqVO.getId())
                .likeIfPresent(FarmModelStageDO::getStage, reqVO.getStage())
                .eqIfPresent(FarmModelStageDO::getModelId, reqVO.getModelId())
                .orderByDesc(FarmModelStageDO::getId));
    }

    default List<FarmModelStageDO> selectList(FarmModelStageExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<FarmModelStageDO>()
                .eqIfPresent(FarmModelStageDO::getId, reqVO.getId())
                .likeIfPresent(FarmModelStageDO::getStage, reqVO.getStage())
                .eqIfPresent(FarmModelStageDO::getModelId, reqVO.getModelId())
                .orderByDesc(FarmModelStageDO::getId));
    }

}
